package work.konbai.bmc.cms.service.impl;


import work.konbai.bmc.cms.dao.MaterialDao;
import work.konbai.bmc.cms.domain.MaterialDO;
import work.konbai.bmc.cms.dto.MaterialDTO;
import work.konbai.bmc.cms.service.MaterialService;
import work.konbai.bmc.cms.vo.MaterialVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class MaterialServiceImpl implements MaterialService {
    @Autowired
    private MaterialDao materialMapper;

    @Override
    public MaterialVO get(Long id){
        return materialMapper.get(id);
    }

    @Override
    public List<MaterialVO> list(Map<String, Object> map){
        return materialMapper.list(map);
    }

    @Override
    public List<MaterialDO> listMaterial() {
        return materialMapper.listMaterial();
    }

    @Override
    public int count(Map<String, Object> map){
        return materialMapper.count(map);
    }

    @Override
    public int save(MaterialDO material){
        return materialMapper.save(material);
    }

    @Override
    public int update(MaterialDO material){
        return materialMapper.update(material);
    }

    @Override
    public int remove(Long id){
        return materialMapper.remove(id);
    }

    @Override
    public List<MaterialDTO> details(Long materialId) {
        return materialMapper.listTransfer(materialId);
    }

    @Override
    public int saveTransfer(MaterialDTO materialDTO){
        return materialMapper.saveTransfer(materialDTO);
    }
}
